﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public class Snake : MonoBehaviour {
    public int count = 4;
    public GameObject BallPrefab;
    public GameObject CountTextGO;
    List<GameObject> ballList = new List<GameObject>();
	// Use this for initialization
	void Start () {
        for (int i = 0; i != count + 1; ++i){
            GameObject ball = Instantiate(BallPrefab) as GameObject;
            ball.transform.SetParent(transform);
            ball.GetComponent<RectTransform>().anchoredPosition3D = new Vector3(0, -54.0f * i, 0);
            ballList.Add(ball);
        }
        CountTextGO.GetComponent<Text>().text = "" + count;
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}
